<template>
  <div>
    <el-container>
      <el-header><el-menu
      background-color="#545c64">
  <img src="../../assets/header.jpg" alt=""><h2>欢迎使用实验室管理系统</h2></el-menu>
</el-header>
      <el-container>
        <el-aside :width="isCollapse ? '64px' : '200px'">
          <div class="toggle-button" @click="toggleCollapse">|||</div>
          <el-menu
            :default-active="this.$route.path"
            router
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            :collapse="isCollapse"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-office-building"></i>
                <span slot="title">实验室管理审核</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/labAdministration">实验室管理</el-menu-item>
                <el-menu-item index="/query">处理实验室申请</el-menu-item>
                <el-menu-item index="/useResults">实验室使用结果</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-thumb"></i>
                <span slot="title">新闻管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/newsType">新闻内容</el-menu-item>
                <!-- <el-menu-item index="/patentList">添加新闻</el-menu-item> -->
              </el-menu-item-group>
            </el-submenu>
            <!-- <el-menu-item index="3" disabled>
              <i class="el-icon-document"></i>
              <span slot="title">导航三</span>
            </el-menu-item>
            <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title">导航四</span>
            </el-menu-item> -->
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isCollapse: true,
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
     toggleCollapse() {
      this.isCollapse = !this.isCollapse
    },
  },
};
</script>

<style lang="scss" scoped>
img{
  width: 64px;
  height: 66px;
  float: left;
}
h2{
  color:#eef0f5;
  text-align: left;
  padding-left: 80px;
  font-family: "宋体",sans-serif;
}
/deep/ .el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
.toggle-button {
  background-color: #4a4064;
  font-size: 10px;
  line-height: 24px;
  color: #fff;
  text-align: center;
  letter-spacing: 0.2em;
  cursor: pointer;
}
</style>